<%@ page import="com.scalar.chiptrack.commons.Constants" %>
<%@ page import="com.scalar.chiptrack.utils.WorkWeek" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/rmaReceive.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();
    String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
  //try {
%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<script language="javascript">
var listSize = 0;

window.onload = init;
function init()
{
    if ( document.rmaReceiveform.customerId  != null)
    {
        qs_1 = new QuickSearch( document.rmaReceiveform.customerId, document.rmaReceiveform.qs1, false);
    }
}

function selectCustomerName()
{
    var form = document.rmaReceiveform;

    if( form.customerId.value == '-1' )
    {
        form.action.value = 'allCustomers';
        form.submit();
        return;
    }
    form.action.value="rmaLots";
    form.submit();
 }

 function loadRmaLotNumbers()
{
    var form = document.rmaReceiveform;

    if( form.rmaReceiveId.value == '0' )
    {
        form.action.value   = "rmaLots";
	    form.submit();
    	return ;
    }
   if( form.rmaReceiveId.value == '-1' )
   {
       form.action.value="loadLotInfo";
       form.submit();
       return ;
   }
   
   form.action.value = "loadLotInfo";
   form.submit();
}
function reset()
{
    document.rmaReceiveform.reset();
    qs_1.resetQuickSearchCntrl();

}
var dateElement = "";
function openCalendar(dateValue)
{
    dateElement = dateValue;
	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
	newWindow.moveTo(550,180);
	newWindow.focus();
}

function assignDate(passedValue)
{
	dateElement.value=passedValue;
	window.focus();
}
        
function searchLots()
{
    var form = document.rmaReceiveform;

    form.action.value="rmaLots";
    form.submit();
}
function quickSearchPartNo()
{
    if ( window.event.keyCode == 13 )
    {
        selectCustomerName();
    }
}
function searchLotsOnSubmit()
{
     var form = document.rmaReceiveform;

    form.action.value="rmaLots";
    form.submit();
}
function customerSelected(form)
{
    var pa=document.getElementById("message");
    var x = form.customerId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "-1")
            {
	            pa.innerHTML = "<li>Select Customer Name</li>";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}

function addMore()
{
    var tab = document.getElementById ("binTable");
    var index = tab.rows.length;

    var d = new Date();
	var day = d.getDate();
	var month = d.getMonth()+1;
	var year = d.getFullYear();
    if ( month < 10 )
		month = "0"+month;
	if ( day < 10 )
		day = "0"+day;
    var today = month+"/"+day+"/"+year;
    
    var newRow = tab.insertRow ( index-4 );
    newRow.bgColor = listSize % 2 == 0 ? "#FFFFEE" : "#DEE1E2";
    var newCell = newRow.insertCell();
    newCell.align = "center"

    var htmltext = '<input type="checkbox" name="rmaReceiveLotsList['+parseInt(listSize,10)+'].checked">';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<select name="rmaReceiveLotsList['+parseInt(listSize,10)+'].processStepId" class="txfield">';
    htmltext = htmltext + '<option value="-1">--Select PartNumber--</option>';
        <logic:present name="partNumbersList">
        <logic:iterate id="partNumber" name="partNumbersList">
        htmltext = htmltext + '<option value="<bean:write property="value" name="partNumber"/>"><bean:write property="label" name="partNumber"/></option>';
        </logic:iterate>
        </logic:present>
        htmltext = htmltext + '</select>';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<input type="text" name="rmaReceiveLotsList['+parseInt(listSize,10)+'].lotNumber" size=15 class="txfield">';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<select name="rmaReceiveLotsList['+parseInt(listSize,10)+'].dateCode" onchange="enableDateCodeField('+parseInt(listSize,10)+')" class="txfield">';
    htmltext = htmltext + '<option value="-1">--Select--</option>';
        <logic:present name="dateCodeList">
        <logic:iterate id="dateCode" name="dateCodeList">
        htmltext = htmltext + '<option value="<bean:write property="value" name="dateCode"/>"><bean:write property="label" name="dateCode"/></option>';
        </logic:iterate>
        </logic:present>
        htmltext = htmltext + '</select>';
        htmltext = htmltext + '<input type="text" style="display:none;" name="rmaReceiveLotsList['+parseInt(listSize,10)+'].dateCode1" class="txfield" size="12" maxlength="20"/>';

    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<input type="text" name="rmaReceiveLotsList['+parseInt(listSize,10)+'].dieQtyIn" size=8 onkeypress="javascript:allowInteger()" class="valuetxfield">';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    newCell.noWrap= "true"
    htmltext ='<input type="text" name="rmaReceiveLotsList['+parseInt(listSize,10)+'].dateIn" maxlength="10" size="12" value="'+today+'" class="txfield">  '
     +'<a href="javascript:openCalendar(document.rmaReceiveform[\'rmaReceiveLotsList['+parseInt(listSize,10)+'].dateIn\'])">'
      +'<img onMouseOver="window.status=\'Click here to select date\';return true" onMouseOut="window.status=\'\';return true" border="0" align="center"'
       +'src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a>';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<select name="rmaReceiveLotsList['+parseInt(listSize,10)+'].locationId" class="txfield">';
    <logic:present name="locationList">
    <logic:iterate id="location" name="locationList">
    htmltext = htmltext + '<option value="<bean:write property="value" name="location"/>"><bean:write property="label" name="location"/></option>';
    </logic:iterate>
    </logic:present>
    htmltext = htmltext + '</select>';
    newCell.innerHTML = htmltext;
    newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<textarea name="rmaReceiveLotsList['+parseInt(listSize,10)+'].comments" class="txfield" rows="2" cols="20">';
    newCell.innerHTML = htmltext;

    listSize++;
}

function save()
{
    var pa=document.getElementById("message");

    pa.innerHTML                = '';
    var form                    = document.rmaReceiveform;
    var count1                  = 0;
    var d = new Date();
	var day = d.getDate();
	var month = d.getMonth()+1;
	var year = d.getFullYear();
	if ( month < 10 )
		month = "0"+month;
	if ( day < 10 )
		day = "0"+day;
	var today = month+"/"+day+"/"+year;

    if(customerSelected(form)==false)
    {
        return;
    }
    if ( form.rmaReceiveNo != null && form.rmaReceiveNo.value == '' )
    {
        pa.innerHTML = "<li> Please enter the RMA Receive No";
        form.rmaReceiveNo.focus();
        return;
    }
    for( var i=0; i < listSize; i++ )
    {
       if ( form['rmaReceiveLotsList['+i+'].checked'].checked == true  )
       {
            if ( form['rmaReceiveLotsList['+i+'].processStepId'].value == '-1')
            {
                pa.innerHTML = "<li> Please select the part Number";
                form['rmaReceiveLotsList['+i+'].processStepId'].focus();
                return;
           }
            if ( form['rmaReceiveLotsList['+i+'].lotNumber'].value == '')
            {
                pa.innerHTML = "<li> Please Enter the Lot Number";
                form['rmaReceiveLotsList['+i+'].lotNumber'].focus();
                return;
           }
           /*if ( form['rmaReceiveLotsList['+i+'].fabLotNumber'].value.trim() == '')
           {
                form['rmaReceiveLotsList['+i+'].fabLotNumber'].value = form['rmaReceiveLotsList['+i+'].lotNumber'].value
           }*/
           if ( form['rmaReceiveLotsList['+i+'].dieQtyIn'].value == '')
           {
                pa.innerHTML = "<li> Please Enter the Qty";
                form['rmaReceiveLotsList['+i+'].dieQtyIn'].focus();
                return;
           }
           if ( form['rmaReceiveLotsList['+i+'].dieQtyIn'] != null && parseInt(form['rmaReceiveLotsList['+i+'].dieQtyIn'].value) == 0 )
           {
                pa.innerHTML = "<li> Zero Qty was not allowed";
                form['rmaReceiveLotsList['+i+'].dieQtyIn'].focus();
                return;
           }
           if ( form['rmaReceiveLotsList['+i+'].locationId'].value == '0')
           {
                pa.innerHTML = "<li> Please select Receive Lcoation";
                form['rmaReceiveLotsList['+i+'].locationId'].focus();
                return;
           }
           if ( form['rmaReceiveLotsList['+i+'].dateIn'] != null && chkDate ( form['rmaReceiveLotsList['+i+'].dateIn'].value , 'DateIn ' , 'Y' ) == false )
            {
              pa.innerHTML = errMsg;
              form['rmaReceiveLotsList['+i+'].dateIn'].focus();
              return;
            }
           if ( form['rmaReceiveLotsList['+i+'].dateIn'].value != null && form['rmaReceiveLotsList['+i+'].dateIn'].value != '')
            {
                if (!validateDateOut(formatDateAsMMDDYYYY(today),formatDateAsMMDDYYYY(form['rmaReceiveLotsList['+i+'].dateIn'].value ) ))
                {
                    pa.innerHTML = "<li>Receive date cannot be less than current Date:<font color='blue'>" + today +"</font>";
                    form['rmaReceiveLotsList['+i+'].dateIn'].focus();
                    return;
                }
            }
           count1++;
       }
    }
    if ( count1== 0 )
    {
        pa.innerHTML = "<li> Please select atleast one lot";
		return;
     }
    form.action.value = "save";
    form.submit();
}

function checkLength(element, size)
{
    if(	element.value.length >= size )
	{
		event.returnValue = false;
	}
}

function enableFields( index )
{
    var pa=document.getElementById("message");

    pa.innerHTML    = '';
    var form        = document.rmaReceiveform;

    if(form['rmaReceiveLotsList['+index+'].checked'].checked == true )
    {
        form['rmaReceiveLotsList['+index+'].processStepId'].disabled = false;
        form['rmaReceiveLotsList['+index+'].lotNumber'].disabled = false;
        form['rmaReceiveLotsList['+index+'].dateCode'].disabled = false;
        form['rmaReceiveLotsList['+index+'].dieQtyIn'].disabled = false;
        form['rmaReceiveLotsList['+index+'].dateIn'].disabled = false;
        form['rmaReceiveLotsList['+index+'].locationId'].disabled = false;
        form['rmaReceiveLotsList['+index+'].comments'].disabled = false;
    }
    else
    {
        if ( form['rmaReceiveLotsList['+index+'].processStepId'].value != "-1")
        {
            form['rmaReceiveLotsList['+index+'].processStepId'].disabled = true;
            form['rmaReceiveLotsList['+index+'].lotNumber'].disabled = true;
            form['rmaReceiveLotsList['+index+'].dateCode'].disabled = true;
            form['rmaReceiveLotsList['+index+'].dieQtyIn'].disabled = true;
            form['rmaReceiveLotsList['+index+'].dateIn'].disabled = true;
            form['rmaReceiveLotsList['+index+'].locationId'].disabled = true;
            form['rmaReceiveLotsList['+index+'].comments'].disabled = true;
        }    
    }
}

function enableDateCodeField( index )
{
    var pa=document.getElementById("message");

    pa.innerHTML                = '';
    var form                    = document.rmaReceiveform;

    if( form['rmaReceiveLotsList['+index+'].dateCode'].value == '0' )
    {
        form['rmaReceiveLotsList['+index+'].dateCode1'].style.display = 'block';
    }
    else
    {
       form['rmaReceiveLotsList['+index+'].dateCode1'].style.display = 'none';
    }

}
</script>
<!-- Top Header Start-->
<%--<%@ include file="/jsp/includes/header.jsp" %>--%>
<logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/header.jsp" %>
    </logic:equal>
    <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/extHeader.jsp" %>
    </logic:notEqual>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
<!-- Side Navigation start -->
<%--<%@ include file="/jsp/operations/dataentryMenu.jsp" %>--%>
    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
    </logic:equal>
    <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/operations/ext_user_dataentryMenu.jsp" %>
    </logic:notEqual>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="80%">
<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<html:form name="rmaReceiveform" onsubmit="javascript:searchLotsOnSubmit();" type="com.scalar.chiptrack.operations.dataentry.rmaReceive.forms.RMAReceiveForm" action="/rmaReceive.do" scope="request">
<input type="hidden" name="action" value="<%= (String)request.getAttribute("action")%>">
<TABLE border="0" width="80%" align=center>
<TR><TD colspan=5 class="NArialW" align="center">RMA Receive&nbsp;</TD><TD width="25%" class="NArialL">&nbsp;</TD></TR>
   
<TR><TD colspan=6>&nbsp;</TD></TR>
<TR><TD colspan=6 class='NArialL'><strong><FONT id="message" styleClass="NArialL" color='FF0000'></FONT></strong></TD></TR>
<TR>
   <TD colspan=5>
  <chiptrack:info  styleClass="NArialL" />
  <chiptrack:errors styleClass="NArialL" />
  <chiptrack:messages type="info" styleClass="NArialL" />
</TD><TD width="20%" class="NArialL">&nbsp;</TD></TR>
<logic:equal name="showMessage" value="TRUE">
    <tr><td colspan=6 align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></TD></TR>
</logic:equal>

<TR><TD colspan=6>
<TABLE  border="0" width="80%" cellpadding="1" cellspacing="1">
    <TR>
        <logic:present name="customersList" >
        <TR>
            <TD width="10%" class="NArialL">&nbsp;</TD>
            <TD class="NArialL" width='15%' align='left'>Quick Search:</TD>
            <td class="NArialL" width='20%'>
            <input type="text" name="qs1" class="txfield" size='25' onkeypress='quickSearch(qs_1);quickSearchPartNo()'/>
            </td>
            <TD width="5%" class="NArialL">&nbsp;</TD>
            <TD width="10%" class="NArialL">&nbsp;</TD>
            <TD width="20%" class="NArialL">&nbsp;</TD>
        </TR>
    </logic:present>
        <logic:present name="customersList" scope="request">
            <TD width="10%" class="NArialL">&nbsp;</TD>
            <TD width="15%" nowrap align='left' class="NArialL">Customer Name:<font color= "red">*</font></TD>
            <TD width="20%" class="NArialL">

            <html:select property="customerId" name="rmaReceiveform" styleClass="txfield" onchange="selectCustomerName()" >
            <html:option value="-1">--Select Customer--</html:option>
            <html:options collection="customersList" property="value" labelProperty="label"/>
            </html:select>
            </TD>
        </logic:present>
        <logic:notPresent name="customersList" scope="request">
            <TD width="5%" class="NArialL">&nbsp;</TD>
            <TD width="15%" class="NArialL">&nbsp;</TD>
            <TD width="20%" class="NArialL">&nbsp;</TD>
        </logic:notPresent>

     <logic:present name="rmaLotsList" scope="request">
            <TD width="5%" class="NArialL">&nbsp;</TD>
            <TD nowrap width="10%" class="NArialL">RMA Receive No:</TD>
            <TD width="20%" class="NArialL">
                <html:select property="rmaReceiveId"  name="rmaReceiveform" styleClass="txfield" onchange="loadRmaLotNumbers()">
                <html:option value="0">Select RMA Receive No</html:option>
                <html:option value="-1">--New RMA Receive No--</html:option>
                <html:options collection="rmaLotsList" property="value" labelProperty="label"/>
                </html:select>
            </TD>
         <html:hidden property="locationId"/>
        </logic:present>
        <logic:notPresent name="rmaLotsList" scope="request">
            <TD width="5%" class="NArialL">&nbsp;</TD>
            <TD width="15%" class="NArialL">&nbsp;</TD>
            <TD width="20%" class="NArialL">&nbsp;</TD>
        </logic:notPresent>

    </TR>
     <TR>
        <TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
    </TR>
    </TABLE>
 </TD>
 </TR>
</TABLE>
    <nested:present property="rmaReceiveLotsList">
    <nested:size id="LotsSize" property="rmaReceiveLotsList"/>
    <logic:greaterThan name="LotsSize" value="0">
        <table border="0" width="80%" cellpadding="1" cellspacing="1">
            <logic:equal name="rmaReceiveform" property="rmaReceiveId" value="-1">
            <TR>
                <td colspan="1">&nbsp;</td>
                <TD width="10%">&nbsp;</TD>
                <TD width="10%" nowrap align='left' class="NArialL">New RMA Receive No:<font color="red"><b>*</b></font></TD>
                <TD width="20%" align='left' class="NArialL"><nested:text property="rmaReceiveNo" styleClass="txfield" size="20" maxlength="50"/></TD>
                <td colspan="2">&nbsp;</td>
            </TR>
            </logic:equal>
            <TR>
                <TD colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
            </TR>
            <TR>
            <td colspan="1">&nbsp;</td>
            <td colspan="5">
                 <table align="left" border="0" id="binTable" width="100%">
                 <tr>
                    <td colspan="8"class='NArialL'><font class='NArialS'><font color='blue'>[Click on Select checkbox to Enter RMA lot]</font></font></td>
                </tr>
                <tr bgcolor="#993333" align="center">
                    <td class='NArialL'><font color="#FFFFFF">Select </font></td>
                    <td class="NArialL"><font color="#FFFFFF">Part Number</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Lot Number</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Date Code</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Qty In</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Date In</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Receive Vendor</font></td>
                    <td class="NArialL"><font color="#FFFFFF">Comments</font></td>
                    <logic:notEqual name="rmaReceiveform" property="rmaReceiveId" value="-1">
                    <td class="NArialL"><font color="#FFFFFF">Close</font></td>
                    </logic:notEqual>
                </tr>

                 <nested:iterate id="rmaLotInfo" property="rmaReceiveLotsList" indexId="iterateIdx" type="com.scalar.chiptrack.operations.dataentry.LotDetails">
                     <nested:hidden property="rmaReceiveLotId"/>
                   <% boolean disabled = false;
                     String click = "enableFields('" + iterateIdx.intValue() + "')";
                   String dateCode = "enableDateCodeField('" + iterateIdx.intValue() + "')";
                       String dateCodevalue = rmaLotInfo.getDateCode();
                 WorkWeek wk = WorkWeek.getCurrentWorkWeekInstance();
                 String currentDateCode = (wk.getWorkWeekYear() + "").substring(2) + wk.getCurrentWWNumber()+"";
                 String currentDateCode1 = (wk.getWorkWeekYear() + "").substring(2) + (wk.getCurrentWWNumber()-1)+"";
                 String currentDateCode2 = (wk.getWorkWeekYear() + "").substring(2) + (wk.getCurrentWWNumber()-2)+"";
                   %>
                  <nested:notEqual name="rmaLotInfo" property="rmaReceiveLotId" value="-1">
                    <% disabled = true; %>
                  </nested:notEqual>
                 <tr bgcolor='<%=iterateIdx.intValue() % 2 == 0 ? "#FFFFEE" : "#DEE1E2"%>'>
                    <td align="center" class='NArialL'><nested:checkbox  name="rmaLotInfo" property="checked" onclick="<%= click %>"/></td>
                    <td align='center'>
                     <nested:select property="processStepId"  styleClass="txfield" disabled="<%=disabled%>">
                        <html:option value="-1">--Select PartNumber--</html:option>
                        <html:options collection="partNumbersList" property="value" labelProperty="label" />
                      </nested:select>
                    </td>

                    <td align='center'>
                       <nested:text property="lotNumber" size="15" styleClass="txfield" disabled="<%=disabled%>"/> <%--disabled="<%=disabled%>"--%>
                     </td>
                     <td align='center'>
                         <nested:select property="dateCode" styleClass="txfield" onchange="<%= dateCode %>" disabled="<%=disabled%>">
                            <html:option value="-1" >-- Select -- </html:option>
                            <% if ( dateCodevalue != null && !"".equalsIgnoreCase(dateCodevalue) && !currentDateCode.equalsIgnoreCase(dateCodevalue) && !currentDateCode1.equalsIgnoreCase(dateCodevalue) && !currentDateCode2.equalsIgnoreCase(dateCodevalue) )
                                {
                            %>
                                <html:option value="<%=dateCodevalue%>"><%=dateCodevalue%></html:option>
                            <%
                                }
                            %>
                            <html:options collection="dateCodeList" property="value" labelProperty="label"/>
                         </nested:select>
                         <nested:text name="rmaLotInfo" style="display:none;" property="dateCode1" styleClass="txfield" size="12" maxlength="20"/>
                     </td>
                     <td align='center'><nested:text property="dieQtyIn"   size="8" styleClass="valuetxfield" disabled="<%=disabled%>" onkeypress="javascript:allowInteger()"/></td>
                     <td align='center' nowrap><nested:text property="dateIn" styleClass="txfield" size="12" maxlength="10" disabled="<%=disabled%>"/>
                         <a href="javascript:openCalendar(document.rmaReceiveform['rmaReceiveLotsList[<%=iterateIdx.intValue()%>].dateIn'])"><img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align="center"
                        src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a></td>
                     <td align='center'>
                        <nested:select property="locationId" styleClass="txfield" disabled="<%=disabled%>">
                            <html:options collection="locationList" property="value" labelProperty="label"/>
                        </nested:select>
                     </td>
                     <td align='center'>
                         <nested:textarea name="rmaLotInfo" property="comments" onkeypress="javascript:checkLength(this, 1000)" disabled="<%=disabled%>" styleClass="txfield" rows="2" cols="20"/>

                     </td>
                     <logic:notEqual name="rmaLotInfo" property="rmaReceiveLotId" value="-1">
                        <td align='center'>
                        <nested:checkbox  name="rmaLotInfo" property = "closed"/>   
                        </td>
                     </logic:notEqual>
                  </tr>
                 </nested:iterate>
                  <nested:size id="binCount" property="rmaReceiveLotsList"/>
                    <script type="text/javascript">
                        listSize = <%= binCount.intValue()%>;
                    </script>
                <TR>
                <TD colspan="8"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></TD>
                </TR>
                <tr>
                    <td colspan="6">&nbsp;</td>
                   <TD colspan="2" align=center><a href="javascript:addMore();"><img src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" border="0" onmouseover="window.status='Click to Add Lot Info';return true" onmouseout="window.status='';return true" title="Click here to Add Lot Info"/></a></TD>
                </tr>
                 <TR>
                    <TD colspan="8"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
                 </TR>
                <TR>
                    <td colspan="2">&nbsp;</td>
                    <td colspan="4" align="center">
                        <a href="javascript:save()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to Save RMA Receive Lots';return true" onmouseout="window.status='';return true"title="Click to Save RMA Receive Lots"/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="javascript:reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
                    </td>
                    <td colspan="2">&nbsp;</td>
                </TR>
                </table>
            </td>
       </TR>
     </table>       
     </logic:greaterThan>
    </nested:present>
</html:form>
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>
<%--<%

    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
%>--%>
